wayland: Plug memory leaks
authorMatthias Clasen <mclasen@redhat.com>
Fri, 5 Jan 2018 03:55:04 +0000 (22:55 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 5 Jan 2018 03:55:04 +0000 (22:55 -0500)
We were forgetting to free the GdkContentFormats
objects in an early exit case.

gdk/wayland/gdkclipboard-wayland.c
gdk/wayland/gdkprimary-wayland.c

index 63c1f756a93d89709dab8271a28dfe4616055e7e..585fb8e28b108fb9b52bace070c7ada32e84588f 100644 (file)
@@ -303,6 +303,7 @@ gdk_wayland_clipboard_claim_remote (GdkWaylandClipboard  *cb,
   if (cb->source)
     {
       GDK_NOTE (CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
+      gdk_content_formats_unref (formats);
       return;
     }
 
index b83f41aeae46459e83a4efd0422b89043464587d..b29a033aaf3166d8965daca0106d84e8c8955fab 100644 (file)
@@ -100,6 +100,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary                  *cb,
   if (cb->source)
     {
       GDK_NOTE (CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
+      gdk_content_formats_unref (formats);
       return;
     }